package com.cy.pj.common.pojo;

/**
 *
 */
public class ResponseResult {
    //响应数据状态
    private static final int SUCCESS = 1;
    private static final int ERROR = 0;
    private Integer state=SUCCESS;//1 success,0 exception
    //状态对应的信息
    private String message="ok";
    //服务器相应到客户端的查询结果
    private Object data;

    public ResponseResult(){

    }
    public ResponseResult(String message){//state=1,message="delete ok"
        this.message=message;
    }
    public ResponseResult(Object data){
        this.data =data;
    }
    public ResponseResult(Throwable e){//出现异常以后可以执行此方法
        this.state=0;
        this.message=e.getMessage();
    }
    public Integer getState() {
        return state;
    }


    public void setState(Integer state) {
        this.state = state;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public Object getData() {
        return data;
    }

    public void setData(Object data) {
        this.data = data;
    }
}
